<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
    'aliases' => array(
        'bootstrap' => realpath(__DIR__ . '/../extensions/bootstrap'),
    //'bootstrap' => 'application.modules.bootstrap'
    ),
    'timeZone' => 'Asia/Shanghai',
    'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
    'name' => 'Booking System',
    'language' => 'zh_cn',
    // preloading 'log' component
    'preload' => array('log'),
    // autoloading model and component classes
    'import' => array(
        'application.models.*',
        'application.components.*',
        'bootstrap.*',
        'bootstrap.components.*',
        'application.vendor.Cron.*',
    ),
    'modules' => array(
        // uncomment the following to enable the Gii tool
        'bootstrap' => array(
            'class' => 'bootstrap.BootStrapModule'
        ),
        'gii' => array(
            'generatorPaths' => array(
                'bootstrap.gii'
            ),
            'class' => 'system.gii.GiiModule',
            'password' => 'bookings',
            // If removed, Gii defaults to localhost only. Edit carefully to taste.
            'ipFilters' => array('127.0.0.1', '::1'),
        ),
    ),
    // application components
    'components' => array(
        'bsHtml' => array(
            'class' => 'bootstrap.components.BSHtml'
        ),
        'clientScript' => array(
            ///*
            'scriptMap' => array(
                'jquery.js' => false,
                'jquery.min.js' => false,
                'jquery-ui.min.js' => false,
            ),
            //*/
            'packages' => array(
                'jquery' => array(
                    'baseUrl' => 'js', //'http://code.jquery.com/',
                    'js' => array('jquery-1.10.2.min.js'),
                    'coreScriptPosition' => CClientScript::POS_HEAD
                ),
                'jquery.ui' => array(
                    'baseUrl' => 'js', //'http://code.jquery.com/',
                    'js' => array('jquery-ui-1.9.2.min.js'),
                    'coreScriptPosition' => CClientScript::POS_HEAD
                ),
                'jqm-setting' => array(
                    'baseUrl' => 'js',
                    'js' => array('jqm-setting.js'), //'http://code.jquery.com/mobile/1.3.2/',
                    'coreScriptPosition' => CClientScript::POS_HEAD
                ),
                'jquery.mobile' => array(
                    'baseUrl' => 'js',
                    'js' => array('jquery.mobile-1.4.2.min.js'),
                    'depends' => array('jquery, jqm-setting'),
                    'coreScriptPosition' => CClientScript::POS_HEAD
                )
            ),
        ),
        'user' => array(
            // enable cookie-based authentication
            'allowAutoLogin' => true,
        ),
        // uncomment the following to enable URLs in path-format
        /*
          'urlManager'=>array(
          'urlFormat'=>'path',
          'rules'=>array(
          '<controller:\w+>/<id:\d+>'=>'<controller>/view',
          '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
          '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
          ),
          ),
         */
        /*
          'db'=>array(
          'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
          ),
         */
        // uncomment the following to use a MySQL database
        'db' => array(
            'connectionString' => 'mysql:host=localhost;dbname=mydb',
            'emulatePrepare' => true,
            'username' => 'test',
            'password' => 'password',
            'charset' => 'utf8',
            'tablePrefix' => 'tbl_',
            'enableParamLogging' => true,
        ),
        'errorHandler' => array(
            // use 'site/error' action to display errors
            'errorAction' => 'site/error',
        ),
        'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                array(
                    'class' => 'CFileLogRoute',
                    'levels' => 'error, warning',
                ),
                // uncomment the following to show log messages on web pages
                array(
                    'class' => 'CWebLogRoute',
                    'levels' => 'trace,info,error,warning,xdebug',
                    'showInFireBug' => true,
                ),
            ),
        ),
    ),
    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    'params' => array(
        // this is used in contact page
        'adminEmail' => 'webmaster@example.com',
    ),
);
